﻿@model IEnumerable<QuanLyGiaoVuUI.Models.MonHoc.MonHocViewModel>
@{
    Layout = null;
}
<style>
    .table-holder {
        height: 400px;
    }
</style>
<body>
    @{using (Ajax.BeginForm("ThemMonHoc", "GiangVien", new { giangVienId = ViewData["giangVienID"] }, new AjaxOptions { HttpMethod = "POST", OnSuccess = "DongCuaSo" }))
      {
        <div class="table-holder">
            <table class="data display datatable">
                <tr>
                    <th class="sorting"><a id="toggle-all"></a></th>
                    <th class="sorting minwidth-1"><a href="">Mã môn học</a></th>
                    <th class="sorting"><a href="javascript:;">Tên môn học</a></th>
                    <th class="sorting"><a href="javascript:;">Tổng số tín chỉ</a></th>
                    <th class="sorting"><a href="javascript:;">Số tín chỉ lý thuyết</a></th>
                </tr>
                @{ int count = 0;}
                @foreach (var item in Model)
                {
                    <tr class="gradeA @(++count % 2 == 0 ? "even" : "odd")">
                        <td>
                            <input type="checkbox" name="selectedIds" value="@item.ID"/>
                        </td>
                        <td>@item.MaMonHoc</td>
                        <td>@item.TenMonHoc</td>
                        <td>@item.TongSoTinChi</td>
                        <td>@item.SoTinChiLyThuyet</td>
                        @*<td>@item.HocKy</td>*@
                        @*<td>@(item.MaMonChinh.Equals(Guid.Empty) == false ? item.MaMonChinh.ToString() : "Không có")</td>*@
                    </tr>
                }
            </table>
        </div>
        <input type="submit" id="submit-mhgv-btn" name="submit-btn" value="Thêm các môn đã chọn" style="display: none" />
      }
    }
</body>
<script>
    function DongCuaSo(data) {
        ThemMonDamNhan(data);
        $(this).closest('.ui-dialog-content').dialog('close');
    }
    $(document).ready(function () {
        $("#submit-btn").button();
    });
</script>
